package com.cqw.commontest.designmode.simplefactory;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Author: caoqingwen
 * @CreateTime: 2021-09-06 11:18
 * @Description:
 */
@RestController
@RequestMapping("/simple/factory")
public class TestFactory {

    @Resource
    private Map<String, Sender> senderMap;


    @GetMapping("/test")
    public String test() {
        Sender sms = senderMap.get("smsSender");
        sms.send();
        return "OK";
    }

}
